"""myproject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from . import views,typeviews,goodsviews


urlpatterns = [
    # 网站后台首页
    url(r'^$', views.index,name="myadmin_index"),

    # 后台登录
    url(r'^login$', views.login,name="myadmin_login"),
    url(r'^vcode$', views.verifycode,name="myadmin_vcode"),
    # 处理登录
    url(r'^dologin$', views.dologin,name="myadmin_dologin"),
    # 退出登录
    url(r'^loginout$', views.loginout,name="myadmin_loginout"),



     # 后台用户列表页
    url(r'^user/index$', views.userindex,name="myadmin_userindex"),
    url(r'^user/index/(?P<pIndex>[0-9]+)$', views.userindex,name="myadmin_userindex"),

    # 后台会员管理
    url(r'^user/add$', views.useradd,name="myadmin_useradd"),
    # 后台用户数据的添加处理
    url(r'^user/insert$', views.userinsert,name="myadmin_userinsert"),
    # 后台用户删除
    url(r'^user/del/(?P<uid>[0-9]+)$', views.userdel,name="myadmin_userdel"),
    # 显示用户编辑的页面
    url(r'^user/edit/(?P<uid>[0-9]+)$', views.useredit,name="myadmin_useredit"),
    # 后台用户数据修改
    url(r'^user/update$', views.userupdate,name="myadmin_userupdate"),


    # 后台分类管理
    # 分类添加
    url(r'^type/add$', typeviews.typeadd,name="myadmin_typeadd"),
    # 执行添加
    url(r'^type/insert$', typeviews.typeinsert,name="myadmin_typeinsert"),
    url(r'^type/index$', typeviews.typeindex,name="myadmin_typeindex"),
    # 删除
    url(r'^type/del/(?P<tid>[0-9]+)$', typeviews.typedel,name="myadmin_typedel"),
    # 编辑
    url(r'^type/edit/(?P<tid>[0-9]+)$', typeviews.typeedit,name="myadmin_typeedit"),
    url(r'^type/update$', typeviews.typeupdate,name="myadmin_typeupdate"),


    # 后台商品管理
    # 商品添加
    url(r'^goods/add$', goodsviews.goodsadd,name="myadmin_goodsadd"),
    url(r'^goods/insert$', goodsviews.goodsinsert,name="myadmin_goodsinsert"),
    
    # 商品列表
    url(r'^goods/index$', goodsviews.goodsindex,name="myadmin_goodsindex"),
    # 商品删除
    url(r'^goods/del/(?P<gid>[0-9]+)$', goodsviews.goodsdel,name="myadmin_goodsdel"),
    # 商品修改
    url(r'^goods/edit/(?P<gid>[0-9]+)$', goodsviews.goodsedit,name="myadmin_goodsedit"),
    url(r'^goods/update$', goodsviews.goodsupdate,name="myadmin_goodsupdate"),



]
